import { axios } from '@/utils/request'

/**
 * 查询作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkPageForTeacher(parameter) {
  return axios({
    url: '/homework/pageForTeacher',
    method: 'get',
    params: parameter
  })
}

/**
 * 查询作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkPageForStudent(parameter) {
  return axios({
    url: '/homework/pageForStudent',
    method: 'get',
    params: parameter
  })
}

/**
 * 作业表列表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkList(parameter) {
  return axios({
    url: '/homework/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 添加作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkAdd(parameter) {
  return axios({
    url: '/homework/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkEdit(parameter) {
  return axios({
    url: '/homework/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkDelete(parameter) {
  return axios({
    url: '/homework/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 导出作业表
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function homeworkExportForTeacher(parameter) {
  return axios({
    url: '/homework/exportForTeacher',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}

/**
 * 上传作业
 *
 * @author kongxm
 * @date 2020/6/30 00:20
 */
export function uploadHomeworkFile(params) {
  return axios({
    url: '/homework/uploadHomework',
    method: 'post',
    data: params
  })
}

/**
 * 上传批改后的作业
 *
 * @author kongxm
 * @date 2020/6/30 00:20
 */
export function uploadCorrectedHomeworkFile(params) {
  return axios({
    url: '/homework/uploadCorrectedHomework',
    method: 'post',
    data: params
  })
}

/**
 * 打分记录列表
 *
 * @author kongxm
 * @date 2022-07-17 14:52:27
 */
export function queryScoreStatistics(parameter) {
  return axios({
    url: '/homework/scoreStatistics',
    method: 'get',
    params: parameter
  })
}

/**
 * 导出分数统计
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function scoreStatisticsExport(parameter) {
  return axios({
    url: '/homework/scoreStatistics/export',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}

/**
 * 批量下载学生作业
 *
 * @author kongxm
 * @date 2022-07-04 16:51:18
 */
export function batchDownloadStudentHomework(parameter) {
  return axios({
    url: '/homework/batchDownloadStudentHomework',
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}

/**
 * 批量下载批改后作业
 *
 * @author kongxm
 * @date 2022-07-04 16:51:18
 */
export function batchDownloadCorrectedHomework(parameter) {
  return axios({
    url: '/homework/batchDownloadCorrectedHomework',
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}

/**
 * 批量上传批改后的作业
 *
 * @author kongxm
 * @date 2020/6/30 00:20
 */
export function batchUploadCorrectedHomeworkFile(params) {
  return axios({
    url: '/homework/batchUploadCorrectedHomework',
    method: 'post',
    data: params
  })
}

/**
 * 查询批次
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function listFrequencyForTeacher(parameter) {
  return axios({
    url: '/homework/listFrequencyForTeacher',
    method: 'get',
    params: parameter
  })
}

/**
 * 学生确认作业
 *
 * @author kongxm
 * @date 2022-07-16 14:40:04
 */
export function stuConfirm(id) {
  return axios({
    url: '/homework/stuConfirm',
    method: 'put',
    params: { id: id }
  })
}
